export default defineStore('tags', {
  state: () => {
    return {
      tags: [
        {
          label: '主页',
          path: '/',
          name: 'home'
        }
      ],
      breadcrumb: [] // 用于缓存, 面包屑
    }
  },
  getters: {
    // 获取tags 名字数组 过滤不缓存的数据
    getTags (state) {
      return state.tags.filter(item => !item.ignoreKeepAlive).map(item => item.name)
    }
  },
  actions: {
    setBreadcrumb (data) {
      this.breadcrumb = data
    }
  }
})
